﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>changeCardPwd</title>
    <script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.validate.js" type="text/javascript"></script>
    <link href="../../Content/Themes/blue2/css.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .allContent{ width:300px; margin: 0px auto;}
        .changeTable tr td{ padding-top:10px; width:20px;}
        .changeTable{ text-align:right;}
        .inputLeft{ text-align:left;}
        .showError{ float: left; border:solid 2px #1E90FF;  width:100px; height:20px;}
         label.error{ color:Red;}
    </style>
</head>
<body class="main">
    <div class="AllWebTopDiv">
        <div class="path">
            <div class="nav">
                <a href="#">修改卡密码</a>
            </div>
        </div>
        <div class="content">
          <div class="allContent">
            <form id="changePwd" method="post">
            <table class="changeTable">
                <tr>
                    <td>
                        <label>
                            会员编号：</label>
                    </td>
                    <td class = "inputLeft">
                        <%:Html.TextBox("memberId", null, new { @readonly = "readonly" })%>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label>
                            会员姓名：</label>
                    </td>
                    <td class = "inputLeft">
                        <%:Html.TextBox("memberName", null, new { @readonly = "readonly" })%>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label>
                            旧密码：</label>
                    </td>
                    <td class = "inputLeft">
                        <%:Html.Password("oldPwd")%>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label>
                            新密码：</label>
                    </td>
                    <td class = "inputLeft">
                        <%:Html.Password("newPwd")%>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label>
                            确认新密码：</label>
                    </td>
                    <td class = "inputLeft">
                        <%:Html.Password("comfirm_Pwd")%>
                    </td>
                </tr>
                 
            </table>
            <br />
            <br />
            <input type="submit" value="确认" class="button2" style=" margin-left:50px;"/>
             <input type="button" value="关闭" onclick="closeWindows()" class="button2"  style=" margin-left:50px;"/>
            </form>
            </div>
        </div>
    </div>
</body>
</html>
<script type="text/javascript">

    var memberId = $('#memberId').val();
    $(document).ready(function () {

        $("#changePwd").validate({
            rules: {
                newPwd: { required: true,
                    minlength: 5
                },
                comfirm_Pwd: {
                    required: true,
                    minlength: 5,
                    equalTo: "#newPwd"
                },
                birthday: "required"

            },
            messages: {
                newPwd: { required: "请输入密码",
                    minlength: jQuery.format("密码不能小于{0}个字符")
                },
                comfirm_Pwd: { required: "请输入确认密码",
                    minlength: jQuery.format("确认密码不能小于{0}个字符"),
                    equalTo: "两次输入密码不一致不一致"
                }
            },
            errorClass: "error"

        });
    });

    function GetQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return (r[2]); return null;
    }
    //关闭窗口
    function closeWindows() {
        var test = GetQueryString("memberId");
        if (test == null || test == "") {
            window.location.href = "/Loading/Index/?src=/Desktop/Index/";
        }
        else {
            var i = parent.layer.getFrameIndex();
            parent.layer.close(i);
        }
    }
</script>